﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataAccess
{
    public class RedisKey
    {
        /// <summary>
        /// Redis缓存Key前缀
        /// </summary>
        public static string Prefix = System.Configuration.ConfigurationManager.AppSettings["Prefix"];

        /// <summary>
        /// 用户登录信息Session
        /// </summary>
        public static string UserSession(string sessionid)
        {
            return string.Format("{0}_UserSession_{1}", Prefix, sessionid);
        }


        /// <summary>
        /// 推广者配置
        /// </summary>
        /// <param name="domain"></param>
        /// <returns></returns>
        public static string SysConfig(string domain)
        {
            return Prefix + "SysConfig_" + domain;
        }
        public static string SysConfig_promoter_id(string promoter_id)
        {
            return Prefix + "SysConfig_pid_" + promoter_id;
        }

        /// <summary>
        /// 代理自主发单状态
        /// </summary>
        /// <param name="au_id"></param>
        /// <returns></returns>
        public static string AgentIndependentSendType(string promoter_id, string au_id)
        {
            return Prefix + "_AgentIndependentSendType_" + promoter_id + "_" + au_id;
        }

        
        /// <summary>
        /// 代理信息缓存
        /// </summary>
        /// <param name="promoter_id"></param>
        /// <param name="au_name"></param>
        /// <returns></returns>
        public static string AgencyUser(string promoter_id, string au_name)
        {
            return string.Format("ZH_AgencyUser_{0}_{1}",   promoter_id, au_name);
        }
             

        public static string Site_Pid(string username,string promoter_id)
        {
            return Prefix + "Site_Pid_" + username + "_" + promoter_id;
        }


        //轮播图换成
        public static string Agent_Tag( int promoter_id)
        {
            return Prefix + "_AGENT_TAGSS_" +  promoter_id;
        }
    }
}
